package com.downguys.controller;

import com.downguys.domain.CheckVerifyCodeMobileParam;
import com.downguys.domain.ClientInfo;
import com.downguys.domain.GetVerifyCodeMobileParam;
import com.downguys.domain.VerifyCodeResult_copy;
import com.downguys.domain.paramobjects.CheckMobileVerifyCodeObj;
import com.downguys.domain.paramobjects.GetMobileVerifyCodeObj;
import com.downguys.result.ReturnResult;
import org.apache.log4j.Logger;
import org.jsondoc.core.annotation.Api;
import org.jsondoc.core.annotation.ApiBodyObject;
import org.jsondoc.core.annotation.ApiMethod;
import org.jsondoc.core.annotation.ApiVersion;
import org.jsondoc.core.pojo.ApiStage;
import org.jsondoc.core.pojo.ApiVisibility;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 验证码服务
 *
 * @author xiyang.qiao
 * @date 2017/1/3 - 20:19
 */
@Api(name = "VerifyCodeController", description = "验证码服务", group = "user", visibility = ApiVisibility.PUBLIC, stage = ApiStage.RC)
@ApiVersion(since = "1.0.0", until = "--")
@Controller
@RequestMapping(value = "/api/verifiy")
public class VerifyCodeController {


    public static final Logger logger = Logger.getLogger(VerifyCodeController.class);


    /**
     * 获取短信验证码
     *
     * @return
     * @author xiyang.qiao
     * @date 2017/1/3 - 21:00
     */
    @ApiMethod(path = "/getVerify",description = "获取验证码",produces = {MediaType.ALL_VALUE})
    @RequestMapping(value = "/getVerify", method = RequestMethod.POST)
    @ResponseBody
    public ReturnResult getMobileVerifyCode(@RequestBody @ApiBodyObject GetMobileVerifyCodeObj getMobileVerifyCodeObj){

        ReturnResult returnResult = new ReturnResult();
        returnResult.setResult(new VerifyCodeResult_copy());

        return returnResult;
    }


    /**
     * 校验验证码服务
     *
     * @return
     * @author xiyang.qiao
     * @date 2017/1/3 - 21:00
     */
    @ApiMethod(path = "/checkVerify",description = "校验验证码",produces = {MediaType.ALL_VALUE})
    @RequestMapping(value = "/checkVerify", method = RequestMethod.POST)
    @ResponseBody
    public ReturnResult checkMobileVerifyCode(
            @RequestBody @ApiBodyObject CheckMobileVerifyCodeObj checkMobileVerifyCodeObj){

        ReturnResult returnResult = new ReturnResult();
        returnResult.setResult(new VerifyCodeResult_copy());
        return returnResult;
    }

}
